<template>
  <div v-for="item in state.list" :key="item" v-memo="[item==state.selected]">
  <input type="checkbox" :checked="item==state.selected" @click="change(item)">
</div>
</template>
<script>
import { reactive } from 'vue'
export default {
  setup(){
    //生成0-100000的数组
    const state = reactive({list:[...Array(100000).keys()], selected: 0})
    //修改当前选中的索引
    const change = (index)=>{
      state.selected = index
    }
    return {state, change}
  }
}
</script>